<template>
  <view class="network-alert" v-if="networkShow">
   <view class="network-content">
	   <view class="network-text">{{props.msg}}</view>
   </view>
   <view class="network-icon" @click="close">
	   <com-icon name="gy_icon_close"  color="#BB670C"></com-icon>
   </view>
  </view>
</template>

<script lang="ts" setup>
import { ref } from 'vue';
const props = defineProps({
		msg:{
			type:String
		}
	});
const networkShow = ref(true)
function close () {
	networkShow.value = !networkShow.value
 }
</script>

<style lang="scss" scoped>
.network-alert {
  background: rgba(255, 248, 241, .8);
  color: #BB670C;
  padding:15rpx;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  .network-content{
	  flex: 1;
	  display: flex;
	  overflow: hidden;
	  white-space: nowrap;
	  .network-text{
		  display: inline-block;
		  animation: scroll 10s linear infinite;
	  }
	   @keyframes scroll {
	      0% {
	        transform: translateX(100%);
	      }
	      100% {
	        transform: translateX(-100%);
	      }
	    }
  }
  .network-icon{
	  margin-left: 10rpx;
  }
}
</style>
